// @ 符号在vue.config.js 中配置， 表示 'src' 路径的别名
import request from '@/utils/request'

const context_path = '/dict'
export default {
  list(parentId) {
    return request({
      url: `${context_path}/list/${parentId}`,
      method: 'get'
      // params: {},
      // data: {}
    })
  },
  removeById(id) {
    return request({
      url: `${context_path}/${id}`,
      method: 'delete'
    })
  },
  save(data) {
    return request({
      url: `${context_path}`,
      method: 'post',
      data: data
    })
  },
  getById(id) {
    return request({
      url: `${context_path}/${id}`,
      method: 'get'
    })
  },
  update(data) {
    return request({
      url: `${context_path}`,
      method: 'put',
      data: data
    })
  },
  getDict(dictCode) {
    return request({
      baseURL: 'http://localhost/finance-loan/core/api',
      url: `/dict/${dictCode}`,
      method: 'get'
    })
  }
}
